package com.example.service;

import com.example.dao.User_rolesMapper;
import com.example.dao.UsersMapper;
import com.example.pojo.User_roles;
import com.example.pojo.Users;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class LoginBoss {

    @Resource
    User_rolesMapper user_rolesMapper;

    @Resource
    UsersMapper usersMapper;

    public boolean loginBoss(String username,String password){

        Users users = usersMapper.login(new Users(username,password));
        User_roles user_roles =user_rolesMapper.selectRoleName(username);

        if(users != null){

            if(user_roles.getRole_name().equals("boss")){
                return true;
            }

        }
        return false;
    }

}
